package cn.gok.common.dao.goods;

import cn.gok.common.entity.goods.Goods;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author: DxlinY
 * @apiNote: 商品持久层
 * @date: 2020/11/4
 * @time: 17:43
 */
@Repository
public interface GoodsMapper extends BaseMapper <Goods> {

    @Select("select " +
            "GOODS_ID," +
            "GOODS_SN," +
            "GOODS_NAME," +
            "effectiveDate," +
            "EXPIRY_DAYS," +
            "GOODS_DESC," +
            "GOODS_DESC," +
            "MARKET_PRICE," +
            "IS_ONSALE " +
            "from g_goods " +
            "<where>" +
            "<if test='catyId != null && catyId != '''>catyId = #{catyId}</if>" +
            "</where>")
    List <Goods> listAll(Object target);
}
